home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1191 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: news.netvision.net.il!usenet
  2. From: simchoni@netvision.net.il (Ami Simchoni)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Hungarian notation
  5. Date: 9 Jan 1996 18:19:31 GMT
  6. Organization: Simchoni Automation Systems Ltd
  7. Message-ID: <4cubjk$gup@news.netvision.net.il>
  8. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd3ga$80a@beatty.slip.netcom.com> <Crawford.819654200@voyager>
  9. NNTP-Posting-Host: ts4cp13.netvision.net.il
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.3
  12.  
  13. In article <Crawford.819654200@voyager>, Crawford@voyager.cris.com 
  14. says...
  15. >
  16. >beatty@netcom.com (Derek Lee Beatty) writes:
  17. >>Does anyone buy the premise of this 
  18. >>argument, that making names more meaningful "definitely reduces 
  19. >>readability?!" 
  20. >
  21. >        The assumption behind your statement is that Hungarian
  22. >notation makes the variable's name "more meaningful". I don't agree
  23. >with that. What happens if the code is changed to use a different
  24. >type? For example, changing null-terminated strings to a C++ string
  25.  
  26. The type in a proper hungarian name should refer to an abstract data type 
  27. (ADT) and not to a language-specific type. 
  28. A part of a naming convention for a specific project is specifying the 
  29. ADTs and their names. That's how the convention increases readability - 
  30. you always know to what type of real-world or software entity the 
  31. variable contains. 
  32. The hungarian convention also makes it easy to remember variable names 
  33. because much of the name is standardized.
  34. If the program uses ADTs, the name shouldn't change whenever the platform 
  35. or implementation changes.
  36. This approach INCREASES portability because it enforces making an ADT for 
  37. every variable and not using language types. It can also be viewed as a 
  38. big headache by some (me included).
  39. What some people have done is to use language-specific types with the 
  40. hugarian convention. This practice certainly does not increase 
  41. readability.
  42.  
  43.